import Vue from "vue";
import VueRouter from "vue-router";
import Count from '../components/Count'
import List from '../components/List'
import Music from '../components/List/Music'
import News from '../components/List/News'
Vue.use(VueRouter)
export default new VueRouter({
    routes: [{
            path: "/count",
            component: Count,
            name: "count"
        },
        {
            path: "/list",
            component: List,
            name: "list",
            children: [{
                    path: "/list/music/:id",
                    component: Music,
                    name: "music"
                },
                {
                    path: "/list/news",
                    component: News,
                    name: "news",
                    props: (route) => {
                        return route.query
                    },
                },
            ]
        },
        {
            path: '/',
            redirect: "/count"
        }

    ]
})